package entity

type CoreInModel struct {
	GatewayInModel
	GatewayId string
	MsgType   int //消息类型  1普通消息  2消息通知
}

type CoreOutModel struct {
	GatewayOutModel
	GatewayId    string
	MsgType      int //消息类型  1普通消息  2消息通知
	ReceiverType int //消息类型  1单人  2广播  3组播  4排除某些
	Clients      []string
}

type CoreResultModel struct {
	CoreOutModel
	ResultType int //1指定网关 2全部网关
}

type HubOnlineItem struct {
	User    UserModel
	Gateway map[string]string
}

type Request struct {
	CoreInModel
	RespondChan chan CoreResultModel
}

const (
	OnlineChangeEventLogin       = 1
	OnlineChangeEventLostConnect = 2
)

type OnlineChangeEvent struct {
	GatewayId string
	User      UserModel
	EventType int
}

type EventRequest struct {
	Data        any
	GatewayId   string
	RespondChan chan CoreResultModel
}
